package com.fau.cm.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 客户提醒内容表
 * @author yangzj
 * @datetime 2014年10月17日,下午5:23:21
 */
@Entity
@Table(name = "medical_call_customer_reminder")
public class MedicalCallCustomerReminder implements Serializable, JSONAware {

	private static final long serialVersionUID = 25086059449201421L;

	private String id; 				// id
	private String cycle; 			// 周期
	private String reminderTime; 	// 提醒时间
	private String operatorId; 		// 提醒对象(话务员id)
	private String content; 		// 内容
	private String customerId;      // 客户id
	private String customerName;    // 客户姓名
	private String hospitalId;		// 医院企业id
	private String ids;				// 多个id
	private Date createTime = new Date();		// 创建时间
	private Date updateTime = new Date();		// 更新时间
	
	private String operatorUser;	// 提醒对象姓名
	private String cycleVal;		// 周期值

	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "cycle", length = 20)
	public String getCycle() {
		return cycle;
	}

	public void setCycle(String cycle) {
		this.cycle = cycle;
	}
	
	@Transient
	public String getCycleVal() {
		return cycleVal;
	}

	public void setCycleVal(String cycleVal) {
		this.cycleVal = cycleVal;
	}
	
	@Column(name = "reminder_time", length = 30)
	public String getReminderTime() {
		return reminderTime;
	}

	public void setReminderTime(String reminderTime) {
		this.reminderTime = reminderTime;
	}

	@Column(name = "operator_id", length = 32)
	public String getOperatorId() {
		return operatorId;
	}

	public void setOperatorId(String operatorId) {
		this.operatorId = operatorId;
	}

	@Column(name = "content", length = 255)
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@Column(name = "customer_id", length = 32)
	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}

	@Column(name = "hospital_id", length = 32)
	public String getHospitalId() {
		return hospitalId;
	}

	public void setHospitalId(String hospitalId) {
		this.hospitalId = hospitalId;
	}

	@Transient
	public String getIds() {
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}
	
	@Transient
	public String getOperatorUser() {
		return operatorUser;
	}

	public void setOperatorUser(String operatorUser) {
		this.operatorUser = operatorUser;
	}
	
	@Column(name = "create_time")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "update_time")
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Transient
	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject obj = new JSONObject();
		obj.put("id", id);
		obj.put("cycleVal", cycleVal);
		obj.put("cycle", cycle);
		obj.put("reminderTime", reminderTime);
		obj.put("operatorUser", operatorUser);
		obj.put("content", content);
		obj.put("customerName", customerName);
		return obj.toString();
	}
}
